package dto

import (
	"github.com/starmotioncf/common/region"
	"github.com/starmotioncf/common/third_account"
)

type MobilePhone struct {
	Area        int    `json:"area" form:"area" query:"area" binding:"required,gt=0"`                         //国家区号
	PhoneNumber string `json:"phoneNumber" form:"phoneNumber" query:"phoneNumber" binding:"required,numeric"` //手机号
}

type AccountProfile struct {
	Uid         uint64        `json:"uid"`          //uid
	Region      region.Region `json:"region"`       //分区
	Duid        string        `json:"duid"`         //靓号
	Nickname    string        `json:"nickname"`     //昵称
	Avatar      string        `json:"avatar"`       //头像
	Gender      uint8         `json:"gender"`       //性别
	CountryCode string        `json:"country_code"` //国家
	Gold        int64         `json:"gold"`         //金币余额
}

type LoginByThirdReq struct {
	IdentityType third_account.IdentityType `json:"identityType" binding:"required"` //第三方类型
	Credential   string                     `json:"credential" binding:"required"`   //第三方登录token
}

type LoginByPhoneAndPwdReq struct {
	MobilePhone
	Password string `json:"password" binding:"required"` //密码
}

type LoginByPhoneAndCaptchaReq struct {
	MobilePhone
	Code   string `json:"code" binding:"required"`    //验证码
	CodeId string `json:"code_id" binding:"required"` //验证码id
}

type AccountRefreshTokenReq struct {
	RefreshToken string `json:"refresh_token" binding:"required"` //刷新token
}

type LoginRes struct {
	Uid                   uint64        `json:"uid"`                   //uid
	Region                region.Region `json:"region"`                //分区
	Token                 string        `json:"token"`                 //token
	ExpiredAt             int64         `json:"expiredAt"`             //token过期时间
	RefreshToken          string        `json:"refreshToken"`          //刷新token
	ExpiredAtRefreshToken int64         `json:"expiredAtRefreshToken"` //刷新token时间
}

type AccountResetPwdReq struct {
	MobilePhone
	Password string `json:"password" binding:"required"`
	Code     string `json:"code" binding:"required"`
	CodeId   string `json:"codeId" binding:"required"`
}

type CheckMobilePhoneRes struct {
	Registered   bool `json:"registered"`   //是否已经注册
	SmsSupported bool `json:"SmsSupported"` //是否支持短信
}
